Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-3244

Custom arrays are not serialized properly by CacheObjectBinaryProcessorImpl

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • ignite-1.4
    • None
    • cache
    • None

    Description

      If to put a custom object array into a cache like this one

                  TestObject[] arr = new TestObject[] {new TestObject(i)};
      
                  cache.put(0, arr);
      

      then it will be serialized as Object[] array in CacheObjectBinaryProcessorImpl.marshallToBinary method.

      This leads to the situation when object's array type is lost and on cache.get the code below produces ClassCastException

      TestObject[] obj = cache.get(i);
      

      The full test is already added into GridCacheBinaryObjectsAbstractSelfTest.testCustomArrays.

      To fix the issue we have to revisit logic of CacheObjectBinaryProcessorImpl.marshallToBinary and CacheObjectContext.unwrapBinary.

      Attachments

        1. tc3.png
          163 kB
          Evgeny Stanilovsky

        Activity

          People

            Unassigned Unassigned
            dmagda Denis A. Magda
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: